<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  

  
  <title>CSS基础知识点--CSS字体样式(font) | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="文字样式属性   文字样式 英文    字体 font-family   文字大小 font-size   文字颜色 color   文字粗细 font-weight   文字样式 font-style   font-family字体属性font-family属性值：具体字体名，字体集 字体集：  Serif  Sans-serif  Monospace  Cursive  Fantasy">
<meta name="keywords" content="CSS">
<meta property="og:type" content="article">
<meta property="og:title" content="CSS基础知识点--CSS字体样式(font)">
<meta property="og:url" content="http://yoursite.com/2019/08/01/CSS基础知识点-CSS字体样式/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="文字样式属性   文字样式 英文    字体 font-family   文字大小 font-size   文字颜色 color   文字粗细 font-weight   文字样式 font-style   font-family字体属性font-family属性值：具体字体名，字体集 字体集：  Serif  Sans-serif  Monospace  Cursive  Fantasy">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-08-03T04:33:24.900Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CSS基础知识点--CSS字体样式(font)">
<meta name="twitter:description" content="文字样式属性   文字样式 英文    字体 font-family   文字大小 font-size   文字颜色 color   文字粗细 font-weight   文字样式 font-style   font-family字体属性font-family属性值：具体字体名，字体集 字体集：  Serif  Sans-serif  Monospace  Cursive  Fantasy">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-CSS基础知识点-CSS字体样式" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/08/01/CSS基础知识点-CSS字体样式/" class="article-date">
  <time datetime="2019-08-01T10:57:31.000Z" itemprop="datePublished">2019-08-01</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/CSS/">CSS</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      CSS基础知识点--CSS字体样式(font)
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <hr>
<h2 id="文字样式属性"><a href="#文字样式属性" class="headerlink" title="文字样式属性"></a>文字样式属性</h2><table>
<thead>
<tr>
<th>文字样式</th>
<th>英文</th>
</tr>
</thead>
<tbody><tr>
<td>字体</td>
<td>font-family</td>
</tr>
<tr>
<td>文字大小</td>
<td>font-size</td>
</tr>
<tr>
<td>文字颜色</td>
<td>color</td>
</tr>
<tr>
<td>文字粗细</td>
<td>font-weight</td>
</tr>
<tr>
<td>文字样式</td>
<td>font-style</td>
</tr>
</tbody></table>
<h2 id="font-family字体属性"><a href="#font-family字体属性" class="headerlink" title="font-family字体属性"></a>font-family字体属性</h2><p>font-family属性值：具体字体名，字体集</p>
<p>字体集：</p>
<ul>
<li><p>Serif</p>
</li>
<li><p>Sans-serif</p>
</li>
<li><p>Monospace</p>
</li>
<li><p>Cursive</p>
</li>
<li><p>Fantasy</p>
</li>
</ul>
<h2 id="font-size文字大小"><a href="#font-size文字大小" class="headerlink" title="font-size文字大小"></a>font-size文字大小</h2><blockquote>
<p>font-size: 绝对单位 | 相对单位</p>
</blockquote>
<h3 id="绝对单位"><a href="#绝对单位" class="headerlink" title="绝对单位"></a>绝对单位</h3><table>
<thead>
<tr>
<th>属性值</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>in</td>
<td>Inch，英寸  1英寸=2.54厘米</td>
</tr>
<tr>
<td>cm</td>
<td>厘米  1厘米=0.394英寸</td>
</tr>
<tr>
<td>mm</td>
<td>毫米  1毫米=0.1厘米</td>
</tr>
<tr>
<td>pt</td>
<td>磅，印刷的点数  72磅=1英寸</td>
</tr>
<tr>
<td>pc</td>
<td>Pica，1pc=12pt</td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th>属性值</th>
<th>CSS2缩放系数1.2</th>
</tr>
</thead>
<tbody><tr>
<td>xx-small</td>
<td>9px</td>
</tr>
<tr>
<td>x-small</td>
<td>11px</td>
</tr>
<tr>
<td>small</td>
<td>13px</td>
</tr>
<tr>
<td>medium（浏览器默认大小）</td>
<td>16px</td>
</tr>
<tr>
<td>large</td>
<td>19px</td>
</tr>
<tr>
<td>x-large</td>
<td>23px</td>
</tr>
<tr>
<td>xx-large</td>
<td>28px</td>
</tr>
</tbody></table>
<p>绝对大小，不能随浏览器分辨率或父元素大小的改变而改变</p>
<h3 id="相对单位"><a href="#相对单位" class="headerlink" title="相对单位"></a>相对单位</h3><ul>
<li><p>px 像素</p>
</li>
<li><p>em / %</p>
</li>
</ul>
<p>移动端一般不用px</p>
<h2 id="color文字颜色"><a href="#color文字颜色" class="headerlink" title="color文字颜色"></a>color文字颜色</h2><p>定义元素内文字颜色</p>
<p>语法：</p>
<blockquote>
<p>color：颜色名 | 十六进制 | RGB</p>
</blockquote>
<h2 id="font-weight文字粗细"><a href="#font-weight文字粗细" class="headerlink" title="font-weight文字粗细"></a>font-weight文字粗细</h2><p>为元素内文字设置粗细</p>
<p>语法：</p>
<blockquote>
<p>font-weight: normal | bold | bolder | lighter | 100~900</p>
</blockquote>
<p>说明：</p>
<p>默认值：normal</p>
<p>400等同于normal，而700等同于bold</p>
<h2 id="font-style文字样式"><a href="#font-style文字样式" class="headerlink" title="font-style文字样式"></a>font-style文字样式</h2><p>为元素内文字设置样式</p>
<p>语法：</p>
<blockquote>
<p>font-style: normal | italic | oblique</p>
</blockquote>
<h2 id="font-variant字体变形"><a href="#font-variant字体变形" class="headerlink" title="font-variant字体变形"></a>font-variant字体变形</h2><p>设置元素中文本为小型大写字母</p>
<p>语法：</p>
<blockquote>
<p>font-variant：normal | small-caps</p>
</blockquote>
<h2 id="font属性简写"><a href="#font属性简写" class="headerlink" title="font属性简写"></a>font属性简写</h2><p>语法：</p>
<blockquote>
<p>font：font-style font-variant font-weight font-size/line-height font-family</p>
</blockquote>
<p>说明：</p>
<ul>
<li><p>值之间空格隔开</p>
</li>
<li><p>注意书写顺序</p>
</li>
<li><p>如果font-family有多个值，用逗号分隔开</p>
</li>
</ul>
<p>注意：</p>
<ol>
<li><p>同时设置font-size和font-family，属性才起作用</p>
</li>
<li><p>前三者顺序是任意的</p>
</li>
<li><p>后两者顺序是font-size在前，font-family在后</p>
</li>
<li><p>如果有前面三者任意一种存在，必须在font-size和font-family前面</p>
</li>
</ol>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/08/01/CSS基础知识点-CSS字体样式/" data-id="ck4r400kf0000l0w06vcbmalk" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/CSS/">CSS</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/08/03/CSS基础知识点-盒子模型/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          CSS基础知识点--盒子模型
        
      </div>
    </a>
  
  
    <a href="/2019/08/01/CSS基础知识点-CSS文本样式/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">CSS基础知识点--CSS文本样式(text)</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Ajax/">Ajax</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS/">CSS</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS3/">CSS3</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Dart/">Dart</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Flutter/">Flutter</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Git/">Git</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/HTML/">HTML</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/HTML5/">HTML5</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JSON/">JSON</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/">Java</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaScript/">JavaScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/QT/">QT</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/React/">React</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Sass/">Sass</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/TheKnowledgeOf/">TheKnowledgeOf</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/TypeScript/">TypeScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/bootstrap/">bootstrap</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/jQuery/">jQuery</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Ajax/">Ajax</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS/">CSS</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS3/">CSS3</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Dart/">Dart</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Flutter/">Flutter</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HTML/">HTML</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HTML5/">HTML5</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JSON/">JSON</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java/">Java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Javascript/">Javascript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/QT/">QT</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/React/">React</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sass/">Sass</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TheKnowledgeOf/">TheKnowledgeOf</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TypeScript/">TypeScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/bootstrap/">bootstrap</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jQuery/">jQuery</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Ajax/" style="font-size: 12.22px;">Ajax</a> <a href="/tags/CSS/" style="font-size: 18.89px;">CSS</a> <a href="/tags/CSS3/" style="font-size: 17.78px;">CSS3</a> <a href="/tags/Dart/" style="font-size: 14.44px;">Dart</a> <a href="/tags/Flutter/" style="font-size: 16.67px;">Flutter</a> <a href="/tags/Git/" style="font-size: 12.22px;">Git</a> <a href="/tags/HTML/" style="font-size: 14.44px;">HTML</a> <a href="/tags/HTML5/" style="font-size: 12.22px;">HTML5</a> <a href="/tags/JSON/" style="font-size: 10px;">JSON</a> <a href="/tags/Java/" style="font-size: 11.11px;">Java</a> <a href="/tags/JavaScript/" style="font-size: 20px;">JavaScript</a> <a href="/tags/Javascript/" style="font-size: 10px;">Javascript</a> <a href="/tags/QT/" style="font-size: 12.22px;">QT</a> <a href="/tags/React/" style="font-size: 15.56px;">React</a> <a href="/tags/Sass/" style="font-size: 11.11px;">Sass</a> <a href="/tags/TheKnowledgeOf/" style="font-size: 11.11px;">TheKnowledgeOf</a> <a href="/tags/TypeScript/" style="font-size: 10px;">TypeScript</a> <a href="/tags/bootstrap/" style="font-size: 11.11px;">bootstrap</a> <a href="/tags/jQuery/" style="font-size: 13.33px;">jQuery</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">December 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">November 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">September 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">July 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">May 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/12/29/Flutter-MaterialApp常用属性介绍/">Flutter-MaterialApp常用属性介绍</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-ListView/">Flutter-ListView</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-AppBar/">Flutter-AppBar</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-TabBar/">Flutter-TabBar</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-按钮/">Flutter-按钮</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>